package com.rd.student.dashuju.sunwenzhuo.day0731;

import java.util.LinkedList;

public class Test1 {
    public static void main(String[] args) {

        LinkedList list = new LinkedList();
        for (int i = 0; i < 20; i++) {
            int num = (int) (Math.random() * 50);
            if (list.contains(num)) {
                i--;
            } else {
                list.add(num);
            }
        }
        System.out.println(list);
    }
}
